ans=0
for i in range(100,1000):
    s=str(i)
    # 考试的时候写快了，应该是s[0],s[1],s[2]
    s2=int(i[0])**3+int(i[1])**3+int(i[2])**3
    if s2==i:
        ans+=1
print(ans)